package com.bleeth.fx.view.demo2;

import com.bleeth.fx.layout.FormBuilder;
import com.bleeth.fx.layout.GirdCell;
import com.bleeth.fx.meta.IForm;
import com.bleeth.fx.meta.View;
import com.bleeth.fx.meta.ViewRouter;
import javafx.beans.property.Property;
import javafx.geometry.Pos;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;

/**
 * @author Sakura
 * @version 1.0
 * @date 2021-11-13 22:17
 **/
@View(value = "content")
public class ContentView implements IForm {

    private VBox contentForm;
    private VBox titleForm;

    @Override
    public Region make(Property... properties) {

        contentForm = FormBuilder.form()
                .addRow(GirdCell.createCell(1, Pos.CENTER))
                .coverCell(0, title())
                .endRow(false)
                .coverRow(GirdCell.createCell(1, Pos.CENTER))
                .coverCellRouter(0,ViewRouter.of("content_box"))
                .endRow(false)
                .build();
        css();
        return contentForm;
    }


    public Region title() {
        titleForm = FormBuilder.form(0D, 80D)
                .addEmptyRow(20D)
                .addRow(GirdCell.createCell(1, Pos.CENTER_LEFT))
                .addCellRouter(0, ViewRouter.of("label_title"))
                .endRow(false)
                .addEmptyRow(10D)
                .addRow(GirdCell.createCell(1, Pos.CENTER_LEFT))
                .addCellRouter(0, ViewRouter.of("label_desc"))
                .endRow(false)
                .addEmptyRow(20D)
                .build();
        return titleForm;
    }


    @Override
    public void css() {

    }


}
